public class StringDemo1 {
    public static void main(String[] args) {
        //用==比较字符串
        String str1 = "abc";
        String str2 = new String("Abc");
        System.out.println(str1 == str2);//false
        //用equals比较字符串
        boolean b = str1.equals(str2);
        System.out.println(b);
        //用equalsIgnoreCase比较字符串，忽略大小写
        boolean b1 = str1.equalsIgnoreCase(str2);
        System.out.println(b1);
    }
}
